<template>
	<!-- 我的钱包 -->
	<view class="share_de" v-if="userinfo">
		<view class="tp_s">
			<view class="tp_s1">
				{{userinfo.q}}
			</view>	
			<view class="tp_s2" @click="copy(userinfo.q)">
				复制
			</view>
		</view>	
		
		<view class="nav_a"  >
			<view class="nav_tp">
				邀请奖励规则
				<!-- <view class="dea">
					联系TA
					<image class="img" src="/static/rig.png"></image>
				</view> -->
			</view>
			<view class="bnt">
				1.邀请好友在蚂蚁矿山挖矿均可为你贡献10%矿石收益。
			</view>
			
			<view class="bnt">
				2.邀请关系可以通过扫二维码、填写邀请码建立，注册后未绑定邀请关系的用户，只能通过填写邀请码建立好友关系。
			</view>
			<view class="bnt">
				3.《蚂蚁游》保留本活动的最终解释权，并将严查虚假邀请行为，一经发现将取消奖励资格。
			</view>
			
		</view>
		
		<view class="bom_s" @click="yaoqing()">
			邀请好友
		</view>	
		
	</view>
</template>

<script>
	import noData from '@/components/noData.vue'
	export default {
		components: {
			noData
		},
		data() {
			return {
				pageIndex: 1, // 当前页
				has_more: false, // 是否有更多
				loadding: false,
				pullUpOn: true,
				list: [],
				money:'',
				type:0,
				
				page: 1,
				total: 0,
				list: [],
				userinfo:null,
			}
		},
		onShow() {
			this.get_userinfo();
		},
		onReachBottom: function() {
		
		},
		computed: {
			noDataShow() {
				return !this.list.length
			}
		},
		methods: {
			yaoqing(){
				uni.navigateTo({
					url: '/pages/share/share'
				});
			},
			copy(data){
				uni.setClipboardData({
				  data:data,//要被复制的内容
				  success:()=>{//复制成功的回调函数
				    uni.showToast({//提示
				      title:'复制成功'
				    })
				  }
				});
				
				
			},
			get_userinfo(){
				let that = this;
				uni.showLoading({ title: '正在加载', mask: true });
				uni.hideLoading();
				that.$api.request('/api/user/get_info', {},uni.getStorageSync('token'), function(res) {
								uni.hideLoading()
								if (res.code === 1) {
									that.userinfo = res.data
								} else {
									uni.showToast({
										title: res.msg,
										icon: 'none'
									})
								}
				});
				
			},
			xq1(){
				console.log(111111111)
				
				uni.navigateTo({
					url: '/pages/share/share_dea'
				});
			},
			xq(){
				
				uni.navigateTo({
					url: '/pages/my/my_log?type=3'
				});
			},
			yaoqing(){
				uni.navigateTo({
					url: '/pages/share/share'
				});
			},
			getInfo(){
				uni.showLoading({
					title: '加载中...'
				})
				this.$http.get(this.$api.userWallet, {
					page: this.pageIndex,
					size: 10
				}).then(res => {
					uni.hideLoading()
					this.loadding = false;
					if (res.code === 1) {
						this.money = res.data.money
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none'
						})
					}
				})
			},
			getList() { // 获取明细列表
				
				uni.showLoading({ title: '正在加载', mask: true });
				var _this = this;
				_this.$api.request('/api/user/topups', {page:this.page,	type:this.type}, uni.getStorageSync('token'), function(res) {
					uni.hideLoading();
					if (res.code == 1) {
						_this.total = res.data.total;
						_this.score = res.data.score
						if (_this.page == 1) {
							_this.list = res.data.data;
						} else {
							_this.list = _this.list.concat(res.data.data);
						}
					}
					uni.hideLoading();
				});
				
			}
			
		}
	}
	
</script>

<style lang="scss">
	page{
		background: #f7f7f7;
	}
	.share_de{
		width: 100%;
		.a{
			
		}
		.tp_s{
			background: #fff;
			border-radius: 0.4em;
			width: 94%;
			margin-left: 3%;border-radius: 0.4em;
			width: 94%;
			margin-left: 3%;
			width: 100%;
			text-align: center;
			margin-top: 10px;
			margin-bottom: 10px;
			padding-bottom: 40rpx;
			padding-top: 40rpx;
			.tp_s1{
				font-size: 45rpx;
				font-weight: 700;
			}
			.tp_s2{
				margin: 0 auto;
				background: #f3f3f3;
				border-radius: 0.1em;
				height: 25px;
				line-height: 25px;
				width: 60px;
				text-align: center;
				color: #dd744f;
				font-size: 20rpx;
				margin-top: 10rpx;
			}
		}
		.topc{
			height: 340rpx;
			width: 100%;
		}
		.nav{
			border-radius: 0.4em;
			width: 94%;
			margin-left: 3%;
			background: #fff;
			.nav_tp{
				padding-top: 25rpx;
				width: 94%;
				margin-left: 3%;
				font-size: 34rpx;
				font-weight: 700;
				.dea{
					color: #999;
					font-size: 18rpx;
					float: right;
					.img{
						width:25rpx;
						height: 25rpx;
					}
				}
			}
			.nav_cnt{
				width: 94%;
				margin-left: 3%;
				font-size: 16rpx;
				color: #999;
				margin-top: 10rpx;
			}
			
			.nav_bnt{
				height: 40px;
				width: 100%;
				margin-top: 20rpx;
				padding-bottom: 23rpx;
				.lef{
					margin-left: 3%;
					float: left;
					.top{
						font-size: 34rpx;
						font-weight: 700;
					}
					.bot{
						margin-top: 6rpx;
						font-size: 24rpx;
						color: #999;
					}
					&:last-child{
						margin-left: 15%;
					}
				}
			}
		}
		
		.nav_s{
			margin-top: 10px;
			padding-bottom:25rpx;
			border-radius: 0.4em;
			width: 94%;
			margin-left: 3%;
			background: #fff;
			.nav_tp{
				padding-top: 25rpx;
				width: 94%;
				margin-left: 3%;
				font-size: 30rpx;
				font-weight: 700;
				.dea{
					color: #999;
					font-size: 18rpx;
					float: right;
					.img{
						width:25rpx;
						height: 25rpx;
					}
				}
			}
			.bnt{
				background: #333;
				width: 92%;
				margin-left: 4%;
		
			
				text-align: center;
				color: #fff;
				margin-top: 30rpx;
				border-radius: 0.3em;
				font-size: 26rpx;
			
			}
		}
		.nav_a{
			margin-top: 10px;
			padding-bottom:25rpx;
			border-radius: 0.4em;
			width: 94%;
			margin-left: 3%;
			background: #fff;
			.nav_tp{
				padding-top: 25rpx;
				width: 94%;
				margin-left: 3%;
				font-size: 30rpx;
				font-weight: 700;
				.dea{
					color: #999;
					font-size: 18rpx;
					float: right;
					.img{
						width:25rpx;
						height: 25rpx;
					}
				}
			}
			.bnt{
				width: 92%;
				margin-left: 4%;
				
				margin-top: 30rpx;
				border-radius: 0.3em;
				font-size: 26rpx;
				.act{
					float: left;
					.img{
						width: 70rpx;
						height: 70rpx;
						border: 20em;
					}
				}
				.msg{
					
					margin-left: 20rpx;
					float: left;
					.tc{
						font-size: 28rpx;
						font-weight: 700;
					}
					.yq{
						font-size: 22rpx;
						color: #999;
						margin-top: 5rpx;
					}
				}
			}
			
		}
		.bom_s{
			position: fixed;
			bottom: 0px;
			background: #333;
			width: 92%;
			margin-left: 4%;
			height: 90rpx;
			line-height: 90rpx;
			text-align: center;
			color: #fff;
			margin-top: 30rpx;
			border-radius: 0.3em;
			font-size: 26rpx;
		}
	}
	
	.head-box {
		position: relative;
		z-index: 99;
		width: 100%;
		padding: 0 30rpx 60rpx;
		box-sizing: border-box;

		background-repeat: no-repeat;
		background-position: top center;
		background-size: 100%;
	}
</style>
